package com.wayhome.srpingbootmybatis.policy.enums;

import com.wayhome.srpingbootmybatis.mbs.util.TldyStepEnum;

public enum PolicyTypeEnum {

    TYPE_1("1", "待遇类"),
    TYPE_2("2", "价格类"),
    TYPE_3("3", "支付类"),
    TYPE_4("4", "目录类"),
    TYPE_5("5", "综合类"),
    TYPE_6("6", "征缴类"),
    TYPE_99("99", "其他政策类别"),
    ;

    private PolicyTypeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private String code;
    private String msg;

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static String getMsgByCode(String code) {
        for (PolicyTypeEnum item : PolicyTypeEnum.values()) {
            if (item.code.equals(code)) {
                return item.msg;
            }
        }
        return null;
    }

    public static String getCodeByMsg(String msg) {
        for (PolicyTypeEnum item : PolicyTypeEnum.values()) {
            if (item.msg.equals(msg)) {
                return item.code;
            }
        }
        return null;
    }
}
